﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using _4T.DAL;
using _4T.Data;

namespace _4T.BLL
{
    public class ProfileStageLinkBLL
    {
        public ProfileStageLinkBLL() { }

        public List<ProfileStageLink> GetStageLinkListByProfileCode(string profileCode)
        {
            ProfileStageLinkDAL stageDAL = new ProfileStageLinkDAL();
            return stageDAL.GetListProfileStatusLink(profileCode);
        }

        public int DeleteProfile(string personalCode, string profileCode)
        {
            return new ProfileStageLinkDAL().DeleteProfile(personalCode, profileCode);
        }

        public ProfileStageLink GetProfileStageLinkByProfileCodeAndStage(string profileCode, int stage)
        {
            CMS_ProfileInfo info = new ProfileInfoDAL().GetLastProfileInfoByProfileCode(profileCode);
            if (info != null)
            {
                ProfileStageLinkDAL stageDAL = new ProfileStageLinkDAL();
                return stageDAL.GetProfileStageLinkByProfileCodeAndStage(info.ProfileInfoCode, stage);
            }
            return null;
        }

        public ProfileStageLink GetProfileStageLinkByProfileInfoCodeAndStage(string profileInfoCode, int stage)
        {
            ProfileStageLinkDAL stageDAL = new ProfileStageLinkDAL();
            return stageDAL.GetProfileStageLinkByProfileCodeAndStage(profileInfoCode, stage);
        }

        /*public int InsertProfileStageLink(int profileStatusID, int stage, string video, string audio, string photo, string description, DateTime editedTime)
        {
            return new ProfileStageLinkBLL().InsertProfileStageLink(profileStatusID, stage, video, audio, photo, description, editedTime);
        }*/

        public int InsertProfileStageLink(string profileInfoCode, int stage, string video, string audio, string photo, string description, DateTime editedTime)
        {
            return new ProfileStageLinkDAL().InsertProfileStageLink(profileInfoCode, stage, video, audio, photo, description, editedTime);
        }
    }
}